package br.ufrgs.ga.model;

/**
 * A chromosome must implements this interface.
 * @author mineiro
 *
 * @param <T> DNA strand type.
 */
public interface IChromosome<T> {
	
	/**
	 * Generate a new chromosome combining the DNA strand of the parents.
	 * @param chromosome
	 * @return
	 */
	public IChromosome<T> reproduce(IChromosome<T> chromosome);
	
	/**
	 * Implements the mutation operator.
	 * This operator must garentee that the result DNA strand is a valid one.
	 */
	public void mutate();
	
	/**
	 * Implements the clone operation.
	 * @return A copy of the chromosome.
	 * @throws CloneNotSupportedException
	 */
	public IChromosome<T> clone() throws CloneNotSupportedException;
	
	/**
	 * returns the Chromosome DNA strand.
	 */
	public T getDnaStrand();
	
	/**
	 * Verify if the Chromosome is a valid one.
	 * @return true if the chromosome is valid, false otherwise.
	 */
	public boolean isValid(T dnaStrand);
}
